import { R_tableData, R_add, R_update, R_remove } from "@/utils/tableData";

import request from '@/utils/request'

export const A_tableData = function(data) {
    return R_tableData({
        method: 'post',
        url: '/SciDirection/list',
        data,
    })
}


export const A_add = function(data) {
    return R_add({
        method: 'post',
        url: '/SciDirection/add',
        data
    })
}


export const A_update = function(data) {
    return R_update({
        method: 'post',
        url: '/SciDirection/update',
        data
    })
}

/**
 * 
 * @param {*} dirkey 
 * @returns 
 */
export const A_remove = function(dirkey) {
    return R_remove({
        method: 'post',
        url: '/SciDirection/delete',
        data: {
            dirkey
        }
    })
}

/**
 * 获取当前部门
 * @returns 请求的部门
 */
export const A_getUtil = async function() {
    let result = await request({
        method: "post",
        url: "/SciDirection/showutils",
    })
    return result
}

/**
 * 切换部门选择
 * @param {*} command 选择的部门
 * @returns 
 */
export const A_changeUtil = async function(command) {
    let result = await request({
        method: "post",
        url: "/SciDirection/getutils",
        data: {
            utilsName: command
        }
    })
    return result
}

export const A_getDisArr=async function(){
    let result =await request({
        method:'get',
        url:'/SciDirection/getDirection'
    })
    return result
}